﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using zzh_the_Visual_Studio.DAL;
using zzh_the_Visual_Studio.Models;

namespace zzh_the_Visual_Studio.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class teachersController : ControllerBase
    {
        private DAL_Teachers dalteachers = new DAL_Teachers();

        [HttpGet]

        //教师界面，仅显示姓名、员工号
        public List<teachers> getTeachers()
        {
            return dalteachers.getTeachers();
        }
        /// <summary>
        /// 查询教师个人信息
        /// </summary>
        /// <param name="a">教师信息中需要查询的值</param>
        /// <returns>获取个人信息</returns>
        /// <remarks>by:zzh 2021/12/10</remarks>
        public List<teachers_colleges> getTeacher(teachers_colleges a)
        {
            return dalteachers.getTeacher(a);
        }
        /// <summary>
        /// 查询本班学生信息
        /// </summary>
        /// <param name="a">本班学生信息中需要查询的值</param>
        /// <returns>获取本班学生信息</returns>
        /// <remarks>by:zzh 2021/12/10</remarks>
        public List<teachers_students> getClassStudents(teachers_students a)
        {
            return dalteachers.getClassStudents(a);
        }
        /// <summary>
        /// 查询本班学生成绩
        /// </summary>
        /// <param name="a">本班学生成绩中需要查询的值</param>
        /// <returns>获取本班学生成绩</returns>
        /// <remarks>by:zzh 2021/12/10</remarks>
        public List<students_scores> getClassScores(students_scores a)
        {
            return dalteachers.getClassScores(a);
        }
        //教师详细信息
        public List<teachers_colleges> detailTeachers()
        {
            return dalteachers.detailTeachers();
        }
        //查看本班学生列表
        public List<students_classes> getStudents()
        {
            return dalteachers.getStudents();
        }
        //模糊查询
        public List<students_classes> selectStudents(string s)
        {
            return dalteachers.selectStudents(s);
        }
        //修改学生信息
        [HttpPost]
        public int changeStudents(students s)
        {
            return dalteachers.changeStudents(s);
        }
        //查看学生成绩
        public List<students_scores> getScores()
        {
            return dalteachers.getScores();
        }
    }
}